/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package org.vale.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Gabriel Bran gbran.u@gmail.com
 */
@Entity
@Table(name = "site")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Site.findAll", query = "SELECT s FROM Site s"),
    @NamedQuery(name = "Site.findByIdsite", query = "SELECT s FROM Site s WHERE s.idsite = :idsite"),
    @NamedQuery(name = "Site.findByOrgname", query = "SELECT s FROM Site s WHERE s.orgname = :orgname"),
    @NamedQuery(name = "Site.findByWebsite", query = "SELECT s FROM Site s WHERE s.website = :website"),
    @NamedQuery(name = "Site.findByPhone", query = "SELECT s FROM Site s WHERE s.phone = :phone"),
    @NamedQuery(name = "Site.findByNewprospective", query = "SELECT s FROM Site s WHERE s.newprospective = :newprospective"),
    @NamedQuery(name = "Site.findByActive", query = "SELECT s FROM Site s WHERE s.active = :active"),
    @NamedQuery(name = "Site.findByNoninterested", query = "SELECT s FROM Site s WHERE s.noninterested = :noninterested"),
    @NamedQuery(name = "Site.findByStreet", query = "SELECT s FROM Site s WHERE s.street = :street"),
    @NamedQuery(name = "Site.findByZipcode", query = "SELECT s FROM Site s WHERE s.zipcode = :zipcode"),
    @NamedQuery(name = "Site.findByTentativefac", query = "SELECT s FROM Site s WHERE s.tentativefac = :tentativefac"),
    @NamedQuery(name = "Site.findByFacilitatorphone", query = "SELECT s FROM Site s WHERE s.facilitatorphone = :facilitatorphone"),
    @NamedQuery(name = "Site.findByFacilitatormail", query = "SELECT s FROM Site s WHERE s.facilitatormail = :facilitatormail"),
    @NamedQuery(name = "Site.findByTtpmou", query = "SELECT s FROM Site s WHERE s.ttpmou = :ttpmou"),
    @NamedQuery(name = "Site.findByPastormou", query = "SELECT s FROM Site s WHERE s.pastormou = :pastormou"),
    @NamedQuery(name = "Site.findByYouth", query = "SELECT s FROM Site s WHERE s.youth = :youth"),
    @NamedQuery(name = "Site.findByRegtraining", query = "SELECT s FROM Site s WHERE s.regtraining = :regtraining"),
    @NamedQuery(name = "Site.findByAttendess", query = "SELECT s FROM Site s WHERE s.attendess = :attendess"),
    @NamedQuery(name = "Site.findByNotes", query = "SELECT s FROM Site s WHERE s.notes = :notes"),
    @NamedQuery(name = "Site.findByDatecreated", query = "SELECT s FROM Site s WHERE s.datecreated = :datecreated"),
    @NamedQuery(name = "Site.findByDatemodified", query = "SELECT s FROM Site s WHERE s.datemodified = :datemodified")})
public class Site implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 15)
    @Column(name = "idsite")
    private String idsite;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "orgname")
    private String orgname;
    @Size(max = 100)
    @Column(name = "website")
    private String website;
    // @Pattern(regexp="^\\(?(\\d{3})\\)?[- ]?(\\d{3})[- ]?(\\d{4})$", message="Invalid phone/fax format, should be as xxx-xxx-xxxx")//if the field contains phone or fax number consider using this annotation to enforce field validation
    @Size(max = 15)
    @Column(name = "phone")
    private String phone;
    @Size(max = 1)
    @Column(name = "newprospective")
    private String newprospective;
    @Size(max = 1)
    @Column(name = "active")
    private String active;
    @Size(max = 1)
    @Column(name = "noninterested")
    private String noninterested;
    @Size(max = 100)
    @Column(name = "street")
    private String street;
    @Size(max = 10)
    @Column(name = "zipcode")
    private String zipcode;
    @Size(max = 50)
    @Column(name = "tentativefac")
    private String tentativefac;
    @Size(max = 15)
    @Column(name = "facilitatorphone")
    private String facilitatorphone;
    @Size(max = 45)
    @Column(name = "facilitatormail")
    private String facilitatormail;
    @Size(max = 1)
    @Column(name = "ttpmou")
    private String ttpmou;
    @Size(max = 1)
    @Column(name = "pastormou")
    private String pastormou;
    @Column(name = "youth")
    private Integer youth;
    @Size(max = 1)
    @Column(name = "regtraining")
    private String regtraining;
    @Column(name = "attendess")
    private Integer attendess;
    @Size(max = 255)
    @Column(name = "notes")
    private String notes;
    @Basic(optional = false)
    @NotNull
    @Column(name = "datecreated")
    @Temporal(TemporalType.TIMESTAMP)
    private Date datecreated;
    @Column(name = "datemodified")
    @Temporal(TemporalType.TIMESTAMP)
    private Date datemodified;
    @JoinColumn(name = "category", referencedColumnName = "idcategory")
    @ManyToOne(optional = false)
    private SiteCategory category;
    @JoinColumn(name = "idcity", referencedColumnName = "idcity")
    @ManyToOne
    private City idcity;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "site")
    private List<ContactSite> contactSiteList;

    public Site() {
    }

    public Site(String idsite) {
        this.idsite = idsite;
    }

    public Site(String idsite, String orgname, Date datecreated, Date datemodified) {
        this.idsite = idsite;
        this.orgname = orgname;
        this.datecreated = datecreated;
        this.datemodified = datemodified;
    }

    public String getIdsite() {
        return idsite;
    }

    public void setIdsite(String idsite) {
        this.idsite = idsite;
    }

    public String getOrgname() {
        return orgname;
    }

    public void setOrgname(String orgname) {
        this.orgname = orgname;
    }

    public String getWebsite() {
        return website;
    }

    public void setWebsite(String website) {
        this.website = website;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getNewprospective() {
        return newprospective;
    }

    public void setNewprospective(String newprospective) {
        this.newprospective = newprospective;
    }

    public String getActive() {
        return active;
    }

    public void setActive(String active) {
        this.active = active;
    }

    public String getNoninterested() {
        return noninterested;
    }

    public void setNoninterested(String noninterested) {
        this.noninterested = noninterested;
    }

    public String getStreet() {
        return street;
    }

    public void setStreet(String street) {
        this.street = street;
    }

    public String getZipcode() {
        return zipcode;
    }

    public void setZipcode(String zipcode) {
        this.zipcode = zipcode;
    }

    public String getTentativefac() {
        return tentativefac;
    }

    public void setTentativefac(String tentativefac) {
        this.tentativefac = tentativefac;
    }

    public String getFacilitatorphone() {
        return facilitatorphone;
    }

    public void setFacilitatorphone(String facilitatorphone) {
        this.facilitatorphone = facilitatorphone;
    }

    public String getFacilitatormail() {
        return facilitatormail;
    }

    public void setFacilitatormail(String facilitatormail) {
        this.facilitatormail = facilitatormail;
    }

    public String getTtpmou() {
        return ttpmou;
    }

    public void setTtpmou(String ttpmou) {
        this.ttpmou = ttpmou;
    }

    public String getPastormou() {
        return pastormou;
    }

    public void setPastormou(String pastormou) {
        this.pastormou = pastormou;
    }

    public Integer getYouth() {
        return youth;
    }

    public void setYouth(Integer youth) {
        this.youth = youth;
    }

    public String getRegtraining() {
        return regtraining;
    }

    public void setRegtraining(String regtraining) {
        this.regtraining = regtraining;
    }

    public Integer getAttendess() {
        return attendess;
    }

    public void setAttendess(Integer attendess) {
        this.attendess = attendess;
    }

    public String getNotes() {
        return notes;
    }

    public void setNotes(String notes) {
        this.notes = notes;
    }

    public Date getDatecreated() {
        return datecreated;
    }

    public void setDatecreated(Date datecreated) {
        this.datecreated = datecreated;
    }

    public Date getDatemodified() {
        return datemodified;
    }

    public void setDatemodified(Date datemodified) {
        this.datemodified = datemodified;
    }

    public SiteCategory getCategory() {
        return category;
    }

    public void setCategory(SiteCategory category) {
        this.category = category;
    }

    public City getIdcity() {
        return idcity;
    }

    public void setIdcity(City idcity) {
        this.idcity = idcity;
    }

    @XmlTransient
    public List<ContactSite> getContactSiteList() {
        return contactSiteList;
    }

    public void setContactSiteList(List<ContactSite> contactSiteList) {
        this.contactSiteList = contactSiteList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idsite != null ? idsite.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Site)) {
            return false;
        }
        Site other = (Site) object;
        if ((this.idsite == null && other.idsite != null) || (this.idsite != null && !this.idsite.equals(other.idsite))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.vale.entity.Site[ idsite=" + idsite + " ]";
    }
    
}
